<template>
	<view>
		<view class="pbtp">
			<view class="flexleft">
				<!-- <view class="ershiba xiaohong fonweight">距离结束还有：</view> -->
				<!-- <u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss" autoStart millisecond @change="onChange">
					<view class="time">
						<view class="time__custom">
							<text
								class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
						</view>
						<text class="time__doc">:</text>
						<view class="time__custom">
							<text class="time__custom__item">{{ timeData.minutes }}</text>
						</view>
						<text class="time__doc">:</text>
						<view class="time__custom">
							<text class="time__custom__item">{{ timeData.seconds }}</text>
						</view>
					</view>
				</u-count-down> -->
			</view>

		</view>
		<!-- <image class="pbtp" src="../static/images/system/ms.png" mode=""></image> -->
		<view class="" style="padding: 1rpx 30rpx 30rpx;">
			<view class="margin_top radius ffffff flexbetween mainpadding" v-for="item in list.data" :key="item.id"  @click="tzspxq(item.id,item.goods_attr)">
				<image class="sptp" :src="item.image_text" mode=""></image>
				<view class="" style="width: 71%;">
					<view class="titletext zhonghei fonweight xiankuan1">{{item.title}}</view>
					<view class="flexbetween margin_top">
						<view class="smalltext xiaohong fonweight">¥
							<text class="sishi xiaohong fonweight">{{item.goodsprice.ms_price}}</text>
						</view>
						<view class="xhtbn flexcenter">立即抢购</view>
					</view>
				</view>
				

			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/goodscl/goodsList', 'GET', {
					page: page || 1,
					limit: _this.limit,
					goods_attr:3,
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			// 跳转拼单详情
			tzspxq(id,attr) {
				uni.navigateTo({
					url: '/pages_lianmengsc/shangpxq?id='+id+"&attr="+attr
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	/deep/.time__doc{
		color:#FF0000 !important;
	}
	/deep/.time__custom{
		background-color:#FF0000 !important;
	}
	.time {
		@include flex;
		align-items: center;

		&__custom {
			margin-top: 4px;
			width: 22px;
			height: 22px;
			background-color: $u-primary;
			border-radius: 4px;
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			justify-content: center;
			align-items: center;

			&__item {
				color: #fff;
				font-size: 12px;
				text-align: center;
			}
		}

		&__doc {
			color: $u-primary;
			padding: 0px 4px;
		}

		&__item {
			color: #606266;
			font-size: 15px;
			margin-right: 4px;
		}
	}

	.xhtbn {
		width: 140rpx;
		height: 55rpx;
		background-color: #FF9341;
		border-radius: 120rpx;
		font-size: 24rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}

	.sptp {
		width: 160rpx;
		height: 160rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
	}

	.pbtp {
		background-size: 100% 100%;
		padding: 160rpx 190rpx 17rpx 190rpx;
		background-image: url('https://kuaixun.yuntaiqikeji.com/uploads/20240201/73b22bf643ad301e69df719dfca07eb1.png');
	}
</style>